/*!
 * File:
 *  radio_comm.h
 *
 * Description:
 *  This file contains the RADIO communication layer.
 *
 * Silicon Laboratories Confidential
 * Copyright 2011 Silicon Laboratories, Inc.
 */
#ifndef _RADIO_COMM_H_
#define _RADIO_COMM_H_




                /* ======================================= *
                 *              I N C L U D E              *
                 * ======================================= */


                /* ======================================= *
                 *          D E F I N I T I O N S          *
                 * ======================================= */

//#define RADIO_CTS_TIMEOUT 255
#define RADIO_CTS_TIMEOUT 5000


                /* ======================================= *
                 *     G L O B A L   V A R I A B L E S     *
                 * ======================================= */



extern unsigned char radioCmd[16u];


                /* ======================================= *
                 *  F U N C T I O N   P R O T O T Y P E S  *
                 * ======================================= */
void vSpi_WriteDataSpi1(unsigned char biDataInLength, unsigned char *pabiDataIn);
void vSpi_ReadDataSpi1(unsigned char biDataOutLength, unsigned char *paboDataOut);
unsigned char bSpi_ReadWriteSpi1(unsigned char biDataIn);

unsigned char radio_comm_GetResp(unsigned char byteCount, unsigned char* pData);
unsigned char radio_comm_PollCTS(void);
void radio_comm_SendCmd(unsigned char byteCount, unsigned char* pData);
unsigned char radio_comm_SendCmdGetResp(unsigned char cmdByteCount, unsigned char* pCmdData, unsigned char respByteCount, unsigned char* pRespData);
void radio_comm_ReadData(unsigned char cmd, char pollCts, unsigned char byteCount, unsigned char* pData);
void radio_comm_WriteData(unsigned char cmd, char pollCts, unsigned char byteCount, unsigned char* pData);


#endif //_RADIO_COMM_H_
